package Math工具类;

/*
 *
 * Java.lang.Math类是数学相关的工具类，里面提供了大量的静态方法，完成与数学相关的操作
 *
 * public staic double abs(double num):获取绝对值
 * public staic double ceil(double num);向上取整
 * public staic double floor(double num);向下取整
 * public staic long round(double num);四舍五入
 *
 * Math.PI表示圆周率
 * */
public class Math0 {
    public static void main(String[] args) {
        System.out.println("绝对值");
        System.out.println(Math.abs(-12382173));
        System.out.println("向上取整");
        System.out.println(Math.ceil((3.0 / 2)));
        System.out.println(Math.ceil(1.5));
        System.out.println("向下取整");
        System.out.println(Math.floor(3.0 / 2));

        System.out.println("四舍五入");
        System.out.println(Math.round(2.5));
        System.out.println(Math.PI);
    }
}
